<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title></title>
		<style>
			.active{
				color: red;
			}
		</style>
	</head>
	<body>
		<script src="./js/vue.js"></script>
		<div id="app">
			<ul>
				<li :class="{active:currentIndx === index}" v-for="(item,index) in movies" :key="item" @click="liClick(index)"
			</ul>
		</div>
		
		<script>
		let app = new Vue({
			el:"#app",
			data:{
				movies:["满江红","保你平安","忠犬八公"],
				currentIndx:''
			},
			methods:{
				liClick(index){
					this.currentIndx = indx
				}
			}
		})
		</script>
	</body>
</html>
